package com.lxp.utlis;

/**
 * @author lxp
 * @Motto 每天一行小代码，健康幸福学JAVA：
 * @create 2022-08-24 10:21
 * @Description:  基于ThreadLocal封装工具类，用户保存和获得当前登录用户的id
 */
public class BaseContext {


    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    public static Long getCurrentId(){
        return threadLocal.get();
    }
}
